﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NewNotice.aspx.cs" Inherits="Enterprise.UI.Web.Modules.Notice.NewNotice" ValidateRequest="false"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link rel="stylesheet" type="text/css" href="/Styles/css/main.css"/>
    <link rel="stylesheet" type="text/css" href="/easyui1.2.6/themes/gray/easyui.css"/>
    <link rel="stylesheet" type="text/css" href="/easyui1.2.6/themes/icon.css"/>
    <link rel="stylesheet" type="text/css" href="/Styles/css/layout.css" />

    <script type="text/javascript" src="/Scripts/jquery-1.7.2.min.js"></script> 
    <script type="text/javascript" src="/easyui1.2.6/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="/easyui1.2.6/locale/easyui-lang-zh_CN.js"></script>         
    <link rel="stylesheet" type="text/css" href="../../Styles/css/ssec-form.css" />
    <script charset="utf-8" src="../../kindeditor-4.1.1/kindeditor.js" type="text/javascript"></script>
    <script charset="utf-8" src="../../kindeditor-4.1.1/lang/zh_CN.js" type="text/javascript"></script>
    <script type="text/javascript">
        var editor;
        KindEditor.ready(function (K) {
            editor = K.create('#tb_Content', { uploadJson: '/kindeditor-4.1.1/upload/upload_json.ashx' });
        });
        function openlist() {
            $('#rcv_users').window('open');
        }
        function closelist() {
            //关闭窗口
            $('#rcv_users').window('close');
            //获取所有选中的节点的子节点
            var node = $('#tt2').tree('getChecked');
            if (node) {
                var children = $('#tt2').tree('getChecked', node.target);
            } else {
                var children = $('#tt2').tree('getChecked');
            }
            var s = '';
            var c = 0;
            for (var i = 0; i < children.length; i++) {
                var v = children[i].id.toString();
                if (v.indexOf("d-") < 0) {
                    s += children[i].id + ',';
                    c++;
                }
            }
            $('#rcvuser_count').text(c);
            $('#rcv_users_value').attr('value', s);
            //开发时请注释alert
            //alert('选中的人员id:'+s);
        }
        $(function () {
            //初始化签收人个数
            var u = $('#rcv_users_value').val();
            if (u) {
                $('#rcvuser_count').text(u.split(',').length);
            }
            else
                $('#rcvuser_count').text(0);
            jQuery.ajaxSetup({ cache: false })
            $('#tt2').tree({
                lines: true,
                checkbox: true,
                url: '/Modules/Json/UserList.aspx?selected=' + $('#rcv_users_value').val(),
                onClick: function (node) {
                    $(this).tree('toggle', node.target);
                    //alert('you click '+node.text);
                },
                onContextMenu: function (e, node) {
                    e.preventDefault();
                    $('#tt2').tree('select', node.target);
                    $('#mm').menu('show', {
                        left: e.pageX,
                        top: e.pageY
                    });
                }
            });
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div style="margin: 3px 0 0 3px;">
        <a class="easyui-linkbutton" iconcls="icon-toolbar" plain="true" href="Notices.aspx?dt=<%=dt %>">
            返回</a></div>
    <div id="contents" class="ssec-form">        
        <ul>
            <li>
                <div class="ssec-label">
                    主题：</div>
            </li>
            <li>
                <div class="ssec-text large">
                    <asp:TextBox ID="tb_Title" runat="server" CssClass="ssec-text-field"></asp:TextBox></div>
            </li>
        </ul>
        <ul>
            <li>
                <div class="ssec-label">
                    内容：</div>
            </li>
            <li style="width: 80%;">
                <asp:TextBox ID="tb_Content" ClientIDMode="Static" runat="server" CssClass="easyui-validatebox"
                    Width="99%"></asp:TextBox>
            </li>
        </ul>
        <ul>
            <li>
                <div class="ssec-label">
                    是否提醒：</div>
            </li>
            <li>
                <div class="ssec-text small">
                    <asp:DropDownList ID="tb_Remind" runat="server">
                        <asp:ListItem Text="是" Value="1"></asp:ListItem>
                        <asp:ListItem Text="否" Value="0"></asp:ListItem>
                    </asp:DropDownList>
                </div>
            </li>
        </ul>
        <ul>
            <li>
                <div class="ssec-label">
                    提示人员：</div>
            </li>
            <li>
                <asp:HiddenField ID="rcv_users_value" runat="server" ClientIDMode="Static" />
                <a href="#" onclick="openlist();">人员列表</a>  |  已选择<span id="rcvuser_count"></span> 人
            </li>
        </ul>
        <ul>
            <li>
                <div class="ssec-label">
                    提示时间：</div>
            </li>
            <li>
                <div class="ssec-text small">
                    <asp:TextBox ID="tb_RemindTime" runat="server" CssClass="easyui-datetimebox" Width="180"></asp:TextBox></div>
            </li>
        </ul>
        <div class="ssec-group-bottom ssec-group-hasicon">
            <asp:LinkButton ID="BtnSave" runat="server" OnClientClick="editor.sync();" CssClass="easyui-linkbutton"
                OnClick="BtnSave_OnClick">保存</asp:LinkButton></div>
    </div>
        <div id="rcv_users" class="easyui-window" closed="true" modal="true" title="人员列表" style="width:180px;height:300px;">
        <ul id="tt2"></ul>
        <a href="#" onclick="closelist();"  class="easyui-linkbutton" >确定</a>
   </div>
    </form>
</body>
</html>
